package com.ghck.server.dao;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.ghck.server.dao.provider.EaseUserProvider;
import com.ghck.server.model.EaseUser;
import com.ghck.server.model.query.EaseUserQuery;
/**
 * 环信用户  <br>
 * t_ease_user <br>
 * v1.0 2016-05-06
 */
 public interface EaseUserMapper {
 	
 	/**
 	*根据id删除 环信用户
 	*/
 	@Delete("delete from t_ease_user where id=#{id}")
 	public Integer deleteById(Integer id);
 	
 	/**
 	* 批量新增 环信用户
 	*/
 	@InsertProvider(method="batchInsert",type=EaseUserProvider.class)
	@Options(useGeneratedKeys=true,keyColumn="id",keyProperty="list[0].id")
 	public Integer batchInsert(List<? extends EaseUser> easeUsers);
 	
 	/**
 	* 新增 环信用户
 	*/
 	@InsertProvider(method="insert",type=EaseUserProvider.class)
	@Options(useGeneratedKeys=true)
 	public Integer insert(EaseUser domain);
 
 	
 	/**
 	*更新 环信用户
 	*/
 	@UpdateProvider(method="update",type=EaseUserProvider.class)
 	public Integer update(EaseUser domain);
 	
 	/**
 	*根据ID查询 环信用户
 	*/
	@Select("select * from t_ease_user where id=#{id}")
	public EaseUser findById(Integer id);
	
	/**
 	*通过query 查询 环信用户
 	*/
 	@SelectProvider(method="findByQuery",type=EaseUserProvider.class)
 	public List<EaseUser> findByQuery(EaseUserQuery query);
 	
 	/**
 	*通过query count总条数
 	*/
 	@SelectProvider(method="countByQuery",type=EaseUserProvider.class)
 	public Integer countByQuery(EaseUserQuery query);
 	
 	/**
 	* 通过ids查询
 	*/
 	@SelectProvider(method="findByIds",type=EaseUserProvider.class)
 	public List<EaseUser> findByIds(List<Integer> ids);
 	
 	@Select("select * from t_ease_user where user_id=#{userId}")
 	public EaseUser findByUserId(Integer userId);
 	
 	@SelectProvider(method="findByUserIds",type=EaseUserProvider.class)
 	public List<EaseUser> findByUserIds(List<Integer> userId);

}	